package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.FamilyInformation;
import cn.wolfcode.crm.service.IFamilyInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("familyInformation")
public class FamilyInformationController {
    @Autowired
    public IFamilyInformationService familyInformationService;


    @ResponseBody
    @RequestMapping("selectByPrimaryKey")
    public FamilyInformation selectByPrimaryKey(Long id) {
        FamilyInformation familyInformation = familyInformationService.selectByPrimaryKey(id);
        return familyInformation ;
    }

    @ResponseBody
    @RequestMapping("selectByEmployeeId")
    public List<FamilyInformation> selectByEmployeeId(Long empId) {
        List<FamilyInformation> familyInformations = familyInformationService.selectByEmployeeId(empId);
        return familyInformations ;
    }

    @RequestMapping("selectAll")
    @ResponseBody
    public List<FamilyInformation> selectAll() {
        return familyInformationService.selectAll();
    }

}
